home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / GNU / emacs.inst / emacs19.idb / usr / gnu / info / elisp-21.z / elisp-21
Encoding:
GNU Info File  |  1994-08-02  |  49.4 KB  |  1,274 lines

  1. This is Info file elisp, produced by Makeinfo-1.55 from the input file
  2. elisp.texi.
  3.  
  4.    This version is newer than the second printed edition of the GNU
  5. Emacs Lisp Reference Manual.  It corresponds to Emacs Version 19.19.
  6.  
  7.    Published by the Free Software Foundation 675 Massachusetts Avenue
  8. Cambridge, MA 02139 USA
  9.  
  10.    Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
  11.  
  12.    Permission is granted to make and distribute verbatim copies of this
  13. manual provided the copyright notice and this permission notice are
  14. preserved on all copies.
  15.  
  16.    Permission is granted to copy and distribute modified versions of
  17. this manual under the conditions for verbatim copying, provided that
  18. the entire resulting derived work is distributed under the terms of a
  19. permission notice identical to this one.
  20.  
  21.    Permission is granted to copy and distribute translations of this
  22. manual into another language, under the above conditions for modified
  23. versions, except that this permission notice may be stated in a
  24. translation approved by the Foundation.
  25.  
  26.    Permission is granted to copy and distribute modified versions of
  27. this manual under the conditions for verbatim copying, provided also
  28. that the section entitled "GNU Emacs General Public License" is included
  29. exactly as in the original, and provided that the entire resulting
  30. derived work is distributed under the terms of a permission notice
  31. identical to this one.
  32.  
  33.    Permission is granted to copy and distribute translations of this
  34. manual into another language, under the above conditions for modified
  35. versions, except that the section entitled "GNU Emacs General Public
  36. License" may be included in a translation approved by the Free Software
  37. Foundation instead of in the original English.
  38.  
  39. 
  40. File: elisp,  Node: Initial Parameters,  Next: X Frame Parameters,  Prev: Parameter Access,  Up: Frame Parameters
  41.  
  42. Initial Frame Parameters
  43. ------------------------
  44.  
  45.    You can specify the parameters for the initial startup frame by
  46. setting `initial-frame-alist' in your `.emacs' file.
  47.  
  48.  - Variable: initial-frame-alist
  49.      This variable's value is an alist of parameter values to when
  50.      creating the initial X window frame.
  51.  
  52.    If these parameters specify a separate minibuffer-only frame, and
  53. you have not created one, Emacs creates one for you.
  54.  
  55.  - Variable: minibuffer-frame-alist
  56.      This variable's value is an alist of parameter values to when
  57.      creating an initial minibuffer-only frame--if such a frame is
  58.      needed, according to the parameters for the main initial frame.
  59.  
  60. 
  61. File: elisp,  Node: X Frame Parameters,  Next: Size And Position,  Prev: Initial Parameters,  Up: Frame Parameters
  62.  
  63. X Window Frame Parameters
  64. -------------------------
  65.  
  66.    Just what parameters a frame has depends on what display mechanism it
  67. uses.  Here is a table of the parameters of an X window frame:
  68.  
  69. `name'
  70.      The name of the frame.
  71.  
  72. `left'
  73.      The screen position of the left edge, in pixels.
  74.  
  75. `top'
  76.      The screen position of the top edge, in pixels.
  77.  
  78. `height'
  79.      The height of the frame contents, in pixels.
  80.  
  81. `width'
  82.      The width of the frame contents, in pixels.
  83.  
  84. `window-id'
  85.      The number of the X window for the frame.
  86.  
  87. `minibuffer'
  88.      Whether this frame has its own minibuffer.  The value `t' means
  89.      yes, `nil' means no, `only' means this frame is just a minibuffer,
  90.      a minibuffer window (in some other frame) means the new frame uses
  91.      that minibuffer.
  92.  
  93. `font'
  94.      The name of the font for text in the frame.  This is a string.
  95.  
  96. `auto-raise'
  97.      Whether selecting the frame raises it (non-`nil' means yes).
  98.  
  99. `auto-lower'
  100.      Whether deselecting the frame lowers it (non-`nil' means yes).
  101.  
  102. `vertical-scroll-bars'
  103.      Whether the frame has a scroll bar for vertical scrolling
  104.      (non-`nil' means yes).
  105.  
  106. `horizontal-scroll-bars'
  107.      Whether the frame has a scroll bar for horizontal scrolling
  108.      (non-`nil' means yes).  (Horizontal scroll bars are not currently
  109.      implemented.)
  110.  
  111. `icon-type'
  112.      The type of icon to use for this frame when it is iconified.
  113.      Non-`nil' specifies a bitmap icon, `nil' a text icon.
  114.  
  115. `foreground-color'
  116.      The color to use for the inside of a character.  We use strings to
  117.      designate colors; the X server defines the meaningful color names.
  118.  
  119. `background-color'
  120.      The color to use for the background of text.
  121.  
  122. `mouse-color'
  123.      The color for the mouse cursor.
  124.  
  125. `cursor-color'
  126.      The color for the cursor that shows point.
  127.  
  128. `border-color'
  129.      The color for the border of the frame.
  130.  
  131. `cursor-type'
  132.      The way to display the cursor.  There are two legitimate values:
  133.      `bar' and `box'.  The value `bar' specifies a vertical bar between
  134.      characters as the cursor.  The value `box' specifies an ordinary
  135.      black box overlaying the character after point; that is the
  136.      default.
  137.  
  138. `border-width'
  139.      The width in pixels of the window border.
  140.  
  141. `internal-border-width'
  142.      The distance in pixels between text and border.
  143.  
  144. `unsplittable'
  145.      If non-`nil', this frame's window is never split automatically.
  146.  
  147. `visibility'
  148.      The state of visibility of the frame.  There are three
  149.      possibilities: `nil' for invisible, `t' for visible, and `icon' for
  150.      iconified.  *Note Visibility of Frames::.
  151.  
  152. `menu-bar-lines'
  153.      The number of lines to allocate at the top of the frame for a menu
  154.      bar.  The default is zero.  *Note Menu Bar::.
  155.  
  156. `parent-id'
  157.      The X Window number of the window that should be the parent of
  158.      this one.  Specifying this lets you create an Emacs window inside
  159.      some other application's window.  (It is not certain this will be
  160.      implemented; try it and see if it works.)
  161.  
  162. 
  163. File: elisp,  Node: Size And Position,  Prev: X Frame Parameters,  Up: Frame Parameters
  164.  
  165. Frame Size And Position
  166. -----------------------
  167.  
  168.    You can read or change the size and position of a frame using the
  169. frame parameters `left', `top', `height' and `width'.  When you create
  170. a frame, you must specify either both size parameters or neither.
  171. Likewise, you must specify either both position parameters or neither.
  172. Whatever geometry parameters you don't specify are chosen by the window
  173. manager in its usual fashion.
  174.  
  175.    Here are some special features for working with sizes and positions:
  176.  
  177.  - Function: set-frame-position FRAME LEFT TOP
  178.      This function sets the position of the top left corner of
  179.      FRAME--to LEFT and TOP.  These arguments are measured in pixels,
  180.      counting from the top left corner of the screen.
  181.  
  182.  - Function: frame-height &optional FRAME
  183.  - Function: frame-width &optional FRAME
  184.      These functions return the height and width of FRAME, measured in
  185.      characters.  If you don't supply FRAME, they use the selected
  186.      frame.
  187.  
  188.  - Function: frame-pixel-height &optional FRAME
  189.  - Function: frame-pixel-width &optional FRAME
  190.      These functions return the height and width of FRAME, measured in
  191.      pixels.  If you don't supply FRAME, they use the selected frame.
  192.  
  193.  - Function: frame-char-height &optional FRAME
  194.  - Function: frame-char-width &optional FRAME
  195.      These functions return the height and width, respectively, of a
  196.      character in FRAME, measured in pixels.  The values depend on the
  197.      choice of font.  If you don't supply FRAME, these functions use
  198.      the selected frame.
  199.  
  200.  - Function: set-frame-size FRAME COLS ROWS
  201.      This function sets the size of FRAME, measured in characters; COLS
  202.      and ROWS specify the new width and height.
  203.  
  204.      To set the size with values measured in pixels, use
  205.      `modify-frame-parameters' to set the `width' and `height'
  206.      parameters.  *Note X Frame Parameters::.
  207.  
  208.    The old-fashioned functions `set-screen-height' and
  209. `set-screen-width', which were used to specify the height and width of
  210. the screen in Emacs versions that did not support multiple frames, are
  211. still usable.  They apply to the selected frame.  *Note Screen Size::.
  212.  
  213.  - Function: x-parse-geometry GEOM
  214.      The function `x-parse-geometry' converts a standard X windows
  215.      geometry string to an alist which you can use as part of the
  216.      argument to `x-create-frame'.
  217.  
  218.      The alist describes which parameters were specified in GEOM, and
  219.      gives the values specified for them.  Each element looks like
  220.      `(PARAMETER . VALUE)'.  The possible PARAMETER values are `left',
  221.      `top', `width', and `height'.
  222.  
  223.           (x-geometry "35x70+0-0")
  224.                => ((width . 35) (height . 70) (left . 0) (top . -1))
  225.  
  226. 
  227. File: elisp,  Node: Deleting Frames,  Next: Finding All Frames,  Prev: Frame Parameters,  Up: Frames
  228.  
  229. Deleting Frames
  230. ===============
  231.  
  232.    Frames remain potentially visible until you explicitly "delete"
  233. them.  A deleted frame cannot appear on the screen, but continues to
  234. exist as a Lisp object until there are no references to it.  There is no
  235. way to cancel the deletion of a frame aside from restoring a saved frame
  236. configuration (*note Frame Configurations::.); this is similar to the
  237. way windows behave.
  238.  
  239.  - Command: delete-frame &optional FRAME
  240.      This function deletes the frame FRAME.  By default, FRAME is the
  241.      selected frame.
  242.  
  243.  - Function: frame-live-p FRAME
  244.      The function `frame-live-p' returns non-`nil' if the frame FRAME
  245.      has not been deleted.
  246.  
  247. 
  248. File: elisp,  Node: Finding All Frames,  Next: Frames and Windows,  Prev: Deleting Frames,  Up: Frames
  249.  
  250. Finding All Frames
  251. ==================
  252.  
  253.  - Function: frame-list
  254.      The function `frame-list' returns a list of all the frames that
  255.      have not been deleted.  It is analogous to `buffer-list' for
  256.      buffers.  The list that you get is newly created, so modifying the
  257.      list doesn't have any effect on the internals of Emacs.
  258.  
  259.  - Function: visible-frame-list
  260.      This function returns a list of just the currently visible frames.
  261.  
  262.  - Function: next-frame &optional FRAME MINIBUF
  263.      The function `next-frame' lets you cycle conveniently through all
  264.      the frames from an arbitrary starting point.  It returns the "next"
  265.      frame after FRAME in the cycle.  If FRAME is omitted or `nil', it
  266.      defaults to the selected frame.
  267.  
  268.      The second argument, MINIBUF, says which frames to consider:
  269.  
  270.     `nil'
  271.           Exclude minibuffer-only frames.
  272.  
  273.     a window
  274.           Consider only the frames using that particular window as their
  275.           minibuffer.
  276.  
  277.     anything else
  278.           Consider all frames.
  279.  
  280.  - Function: previous-frame &optional FRAME MINIBUF
  281.      Like `next-frame', but cycles through all frames in the opposite
  282.      direction.
  283.  
  284. 
  285. File: elisp,  Node: Frames and Windows,  Next: Minibuffers and Frames,  Prev: Finding All Frames,  Up: Frames
  286.  
  287. Frames and Windows
  288. ==================
  289.  
  290.    All the non-minibuffer windows in a frame are arranged in a tree of
  291. subdivisions; the root of this tree is available via the function
  292. `frame-root-window'.  Each window is part of one and only one frame;
  293. you can get the frame with `window-frame'.
  294.  
  295.  - Function: frame-root-window FRAME
  296.      This returns the root window of frame FRAME.
  297.  
  298.  - Function: window-frame WINDOW
  299.      This function returns the frame that WINDOW is on.
  300.  
  301.    At any time, exactly one window on any frame is "selected within the
  302. frame".  The significance of this designation is that selecting the
  303. frame also selects this window.  You can get the frame's current
  304. selected window with `frame-selected-window'.
  305.  
  306.  - Function: frame-selected-window FRAME
  307.      This function returns the window on FRAME which is selected within
  308.      FRAME.
  309.  
  310.    Conversely, selecting a window for Emacs with `select-window' also
  311. makes that window selected within its frame.  *Note Selecting Windows::.
  312.  
  313. 
  314. File: elisp,  Node: Minibuffers and Frames,  Next: Input Focus,  Prev: Frames and Windows,  Up: Frames
  315.  
  316. Minibuffers and Frames
  317. ======================
  318.  
  319.    Normally, each frame has its own minibuffer window at the bottom,
  320. which is used whenever that frame is selected.  If the frame has a
  321. minibuffer, you can get it with `minibuffer-window' (*note Minibuffer
  322. Misc::.).
  323.  
  324.    However, you can also create a frame with no minibuffer.  Such a
  325. frame must use the minibuffer window of some other frame.  When you
  326. create the frame, you can specify explicitly the frame on which to find
  327. the minibuffer to use.  If you don't, then the minibuffer is found in
  328. the frame which is the value of the variable
  329. `default-minibuffer-frame'.  Its value should be a frame which does
  330. have a minibuffer.
  331.  
  332. 
  333. File: elisp,  Node: Input Focus,  Next: Visibility of Frames,  Prev: Minibuffers and Frames,  Up: Frames
  334.  
  335. Input Focus
  336. ===========
  337.  
  338.    At any time, one frame in Emacs is the "selected frame".  The
  339. selected window always resides on the selected frame.
  340.  
  341.  - Function: selected-frame
  342.      This function returns the selected frame.
  343.  
  344.    The X server normally directs keyboard input to the X window that the
  345. mouse is in.  Some window managers use mouse clicks or keyboard events
  346. to "shift the focus" to various X windows, overriding the normal
  347. behavior of the server.
  348.  
  349.    Lisp programs can switch frames "temporarily" by calling the
  350. function `select-frame'.  This does not override the window manager;
  351. rather, it escapes from the window manager's control until that control
  352. is somehow reasserted.
  353.  
  354.  - Function: select-frame FRAME
  355.      This function selects frame FRAME, temporarily disregarding the X
  356.      Windows focus.  The selection of FRAME lasts until the next time
  357.      the user does something to select a different frame, or until the
  358.      next time this function is called.
  359.  
  360.    Emacs cooperates with the X server and the window managers by
  361. arranging to select frames according to what the server and window
  362. manager ask for.  It does so by generating a special kind of input
  363. event, called a "focus" event.  The command loop handles a focus event
  364. by calling `internal-select-frame'.  *Note Focus Events::.
  365.  
  366.  - Function: internal-select-frame FRAME
  367.      This function selects frame FRAME, assuming that the X server
  368.      focus already points to FRAME.
  369.  
  370.      Focus events normally do their job by invoking this command.
  371.      Don't call it for any other reason.
  372.  
  373. 
  374. File: elisp,  Node: Visibility of Frames,  Next: Raising and Lowering,  Prev: Input Focus,  Up: Frames
  375.  
  376. Visibility of Frames
  377. ====================
  378.  
  379.    A frame may be "visible", "invisible", or "iconified".  If it is
  380. visible, you can see its contents.  If it is iconified, the frame's
  381. contents do not appear on the screen, but an icon does.  If the frame
  382. is invisible, it doesn't show in the screen, not even as an icon.
  383.  
  384.  - Command: make-frame-visible &optional FRAME
  385.      This function makes frame FRAME visible.  If you omit FRAME, it
  386.      makes the selected frame visible.
  387.  
  388.  - Command: make-frame-invisible &optional FRAME
  389.      This function makes frame FRAME invisible.  If you omit FRAME, it
  390.      makes the selected frame invisible.
  391.  
  392.  - Command: iconify-frame &optional FRAME
  393.      This function iconifies frame FRAME.  If you omit FRAME, it
  394.      iconifies the selected frame.
  395.  
  396.  - Function: frame-visible-p FRAME
  397.      This returns the visibility status of frame FRAME.  The value is
  398.      `t' if FRAME is visible, `nil' if it is invisible, and `icon' if
  399.      it is iconified.
  400.  
  401.    The visibility status of a frame is also available as a frame
  402. parameter.  You can read or change it as such.  *Note X Frame
  403. Parameters::.
  404.  
  405. 
  406. File: elisp,  Node: Raising and Lowering,  Next: Frame Configurations,  Prev: Visibility of Frames,  Up: Frames
  407.  
  408. Raising and Lowering Frames
  409. ===========================
  410.  
  411.    The X window system uses a desktop metaphor.  Part of this metaphor
  412. is the idea that windows are stacked in a notional third dimension
  413. perpendicular to the screen surface, and thus ordered from "highest" to
  414. "lowest".  Where two windows overlap, the one higher up covers the one
  415. underneath.  Even a window at the bottom of the stack can be seen if no
  416. other window overlaps it.
  417.  
  418.    A window's place in this ordering is not fixed; in fact, users tend
  419. to change the order frequently.  "Raising" a window means moving it
  420. "up", to the top of the stack.  "Lowering" a window means moving it to
  421. the bottom of the stack.  This motion is in the notional third
  422. dimension only, and does not change the position of the window on the
  423. screen.
  424.  
  425.    You can raise and lower Emacs's X windows with these functions:
  426.  
  427.  - Function: raise-frame FRAME
  428.      This function raises frame FRAME.
  429.  
  430.  - Function: lower-frame FRAME
  431.      This function lowers frame FRAME.
  432.  
  433.    You can also specify auto-raise (raising automatically when a frame
  434. is selected) or auto-lower (lowering automatically when it is
  435. deselected) for any frame using frame parameters.  *Note X Frame
  436. Parameters::.
  437.  
  438. 
  439. File: elisp,  Node: Frame Configurations,  Next: Mouse Tracking,  Prev: Raising and Lowering,  Up: Frames
  440.  
  441. Frame Configurations
  442. ====================
  443.  
  444.  - Function: current-frame-configuration
  445.      This function returns a "frame configuration" list which describes
  446.      the current arrangement of frames, all their properties, and the
  447.      window configuration of each one.
  448.  
  449.  - Function: set-frame-configuration CONFIGURATION
  450.      This function restores the state of frames described in
  451.      CONFIGURATION.
  452.  
  453. 
  454. File: elisp,  Node: Mouse Tracking,  Next: Mouse Position,  Prev: Frame Configurations,  Up: Frames
  455.  
  456. Mouse Tracking
  457. ==============
  458.  
  459.    Sometimes it is useful to "track" the mouse, which means, to display
  460. something to indicate where the mouse is and move the indicator as the
  461. mouse moves.  For efficient mouse tracking, you need a way to wait until
  462. the mouse actually moves.
  463.  
  464.    The convenient way to track the mouse is to ask for events to
  465. represent mouse motion.  Then you can wait for motion by waiting for an
  466. event.  In addition, you can easily handle any other sorts of events
  467. that may occur.  That is useful, because normally you don't want to
  468. track the mouse forever--only until some other event, such as the
  469. release of a button.
  470.  
  471.  - Special Form: track-mouse BODY...
  472.      Execute BODY, meanwhile generating input events for mouse motion.
  473.      The code in BODY can read these events with `read-event' or
  474.      `read-key-sequence'.  *Note Motion Events::, for the format of
  475.      mouse motion events.
  476.  
  477.      The value of `track-mouse' is that of the last form in BODY.
  478.  
  479.    The usual purpose of tracking mouse motion is to indicate on the
  480. screen the consequences of pushing or releasing a button at the current
  481. position.
  482.  
  483. 
  484. File: elisp,  Node: Mouse Position,  Next: Pop-Up Menus,  Prev: Mouse Tracking,  Up: Frames
  485.  
  486. Mouse Position
  487. ==============
  488.  
  489.    The new functions `mouse-position' and `set-mouse-position' give
  490. access to the current position of the mouse.
  491.  
  492.  - Function: mouse-position
  493.      This function returns a description of the position of the mouse.
  494.      The value looks like `(FRAME X . Y)', where X and Y are integers
  495.      giving the position in pixels relative to the top left corner of
  496.      the inside of FRAME.
  497.  
  498.  - Function: set-mouse-position FRAME X Y
  499.      Thus function "warps the mouse" to position X, Y in frame FRAME.
  500.      The arguments X and Y are integers, giving the position in pixels
  501.      relative to the top left corner of the inside of FRAME.
  502.  
  503.      Warping the mouse means changing the screen position of the mouse
  504.      as if the user had moved the physical mouse--thus simulating the
  505.      effect of actual mouse motion.
  506.  
  507. 
  508. File: elisp,  Node: Pop-Up Menus,  Next: X Selections,  Prev: Mouse Position,  Up: Frames
  509.  
  510. Pop-Up Menus
  511. ============
  512.  
  513.  - Function: x-popup-menu POSITION MENU
  514.      This function displays a pop-up menu and returns an indication of
  515.      what selection the user makes.
  516.  
  517.      The argument POSITION specifies where on the screen to put the
  518.      menu.  It can be either a mouse button event (which says to put
  519.      the menu where the user actuated the button) or a list of this
  520.      form:
  521.  
  522.           ((XOFFSET YOFFSET) WINDOW)
  523.  
  524.      where XOFFSET and YOFFSET are positions measured in characters,
  525.      counting from the top left corner of WINDOW's frame.
  526.  
  527.      The argument MENU says what to display in the menu.  It can be a
  528.      keymap or a list of keymaps (*note Menu Keymaps::.).
  529.      Alternatively, it can have the following form:
  530.  
  531.           (TITLE PANE1 PANE2...)
  532.  
  533.      where each pane is a list of form
  534.  
  535.           (TITLE (LINE ITEM)...)
  536.  
  537.      Each LINE should be a string, and each ITEM should be the value to
  538.      return if that LINE is chosen.
  539.  
  540. 
  541. File: elisp,  Node: X Selections,  Next: X Server,  Prev: Pop-Up Menus,  Up: Frames
  542.  
  543. X Selections
  544. ============
  545.  
  546.    The X server records a set of "selections" which permit transfer of
  547. data between application programs.  The various selections are
  548. distinguished by "selection types", represented in Emacs by symbols.  X
  549. clients including Emacs can read or set the selection for any given
  550. type.
  551.  
  552.  - Function: x-set-selection TYPE DATA
  553.      This function sets a "selection" in the X server.  It takes two
  554.      arguments: a selection type TYPE, and the value to assign to it,
  555.      DATA.  If DATA is `nil', it means to clear out the selection.
  556.      Otherwise, DATA may be a string, a symbol, an integer (or a cons
  557.      of two integers or list of two integers), or a cons of two markers
  558.      pointing to the same buffer.  In the last case, the selection is
  559.      considered to be the text between the markers.  The data may also
  560.      be a vector of valid non-vector selection values.
  561.  
  562.      Each possible TYPE has its own selection value, which changes
  563.      independently.  The usual values of TYPE are `PRIMARY' and
  564.      `SECONDARY'; these are symbols with upper-case names, in accord
  565.      with X Windows conventions.  The default is `PRIMARY'.
  566.  
  567.  - Function: x-get-selection TYPE DATA-TYPE
  568.      This function accesses selections set up by Emacs or by other X
  569.      clients.  It takes two optional arguments, TYPE and DATA-TYPE.
  570.      The default for TYPE, the selection type, is `PRIMARY'.
  571.  
  572.      The DATA-TYPE argument specifies the form of data conversion to
  573.      use, to convert the raw data obtained from another X client into
  574.      Lisp data.  Meaningful values include `TEXT', `STRING', `TARGETS',
  575.      `LENGTH', `DELETE', `FILE_NAME', `CHARACTER_POSITION',
  576.      `LINE_NUMBER', `COLUMN_NUMBER', `OWNER_OS', `HOST_NAME', `USER',
  577.      `CLASS', `NAME', `ATOM', and `INTEGER'.  (These are symbols with
  578.      upper-case names in accord with X conventions.)  The default for
  579.      DATA-TYPE is `STRING'.
  580.  
  581.    The X server also has a set of numbered "cut buffers" which can
  582. store text or other data being moved between applications.  Cut buffers
  583. are considered obsolete, but Emacs supports them for the sake of X
  584. clients that still use them.
  585.  
  586.  - Function: x-get-cut-buffer N
  587.      This function returns the contents of cut buffer number N.
  588.  
  589.  - Function: x-set-cut-buffer STRING
  590.      This function stores STRING into the first cut buffer (cut buffer
  591.      0), moving the other values down through the series of cut buffers,
  592.      kill-ring-style.
  593.  
  594. 
  595. File: elisp,  Node: X Server,  Prev: X Selections,  Up: Frames
  596.  
  597. X Server
  598. ========
  599.  
  600.    This section describes how to access and change the overall status of
  601. the X server Emacs is using.
  602.  
  603. * Menu:
  604.  
  605. * X Connections::    Opening and closing the X server connection.
  606. * Resources::        Getting resource values from the server.
  607. * Server Data::        Getting info about the X server.
  608.  
  609. 
  610. File: elisp,  Node: X Connections,  Next: Resources,  Up: X Server
  611.  
  612. X Connections
  613. -------------
  614.  
  615.    You can close the connection with the X server with the function
  616. `x-close-current-connection', and open a new one with
  617. `x-open-connection' (perhaps with a different server and display).
  618.  
  619.  - Function: x-close-current-connection
  620.      This function closes the connection to the X server.  It deletes
  621.      all frames, making Emacs effectively inaccessible to the user;
  622.      therefore, a Lisp program that closes the connection should open
  623.      another one.
  624.  
  625.  - Function: x-open-connection DISPLAY &optional RESOURCE-STRING
  626.      This function opens a connection to an X server, for use of display
  627.      DISPLAY.
  628.  
  629.      The optional argument RESOURCE-STRING is a string of resource
  630.      names and values, in the same format used in the `.Xresources'
  631.      file.  The values you specify override the resource values
  632.      recorded in the X server itself.  Here's an example of what this
  633.      string might look like:
  634.  
  635.           "*BorderWidth: 3\n*InternalBorder: 2\n"
  636.  
  637.  - Function: x-color-display-p
  638.      This returns `t' if the connected X display has color, and `nil'
  639.      otherwise.
  640.  
  641.  - Function: x-color-defined-p COLOR
  642.      This function reports whether a color name is meaningful and
  643.      supported on the X display Emacs is using.  It returns `t' if the
  644.      display supports that color; otherwise, `nil'.
  645.  
  646.      Black-and-white displays support just two colors, `"black"' or
  647.      `"white"'.  Color displays support many other colors.
  648.  
  649.  - Function: x-synchronize FLAG
  650.      The function `x-synchronize' enables or disables synchronous
  651.      communication with the X server.  It enables synchronous
  652.      communication if FLAG is non-`nil', and disables it if FLAG is
  653.      `nil'.
  654.  
  655.      In synchronous mode, Emacs waits for a response to each X protocol
  656.      command before doing anything else.  This is useful for debugging
  657.      Emacs, because protocol errors are reported right away, which
  658.      helps you find the erroneous command.  Synchronous mode is not the
  659.      default because it is much slower.
  660.  
  661. 
  662. File: elisp,  Node: Resources,  Next: Server Data,  Prev: X Connections,  Up: X Server
  663.  
  664. Resources
  665. ---------
  666.  
  667.  - Function: x-get-resource ATTRIBUTE &optional NAME CLASS
  668.      The function `x-get-resource' retrieves a resource value from the X
  669.      Windows defaults database.
  670.  
  671.      Resources are indexed by a combination of a "key" and a "class".
  672.      This function searches using a key of the form
  673.      `INSTANCE.ATTRIBUTE', where INSTANCE is the name under which Emacs
  674.      was invoked, and uses `Emacs' as the class.
  675.  
  676.      The optional arguments COMPONENT and SUBCLASS add to the key and
  677.      the class, respectively.  You must specify both of them or neither.
  678.      If you specify them, the key is `INSTANCE.COMPONENT.ATTRIBUTE',
  679.      and the class is `Emacs.SUBCLASS'.
  680.  
  681. 
  682. File: elisp,  Node: Server Data,  Prev: Resources,  Up: X Server
  683.  
  684. Data about the X Server
  685. -----------------------
  686.  
  687.    This section describes functions and a variable that you can use to
  688. get information about the capabilities and origin of the X server that
  689. Emacs is displaying its frames on.
  690.  
  691.  - Function: x-display-screens
  692.      This function returns the number of screens associated with the
  693.      current display.
  694.  
  695.  - Function: x-server-version
  696.      This function returns the list of version numbers of the X server
  697.      in use.
  698.  
  699.  - Function: x-server-vendor
  700.      This function returns the vendor supporting the X server in use.
  701.  
  702.  - Function: x-display-pixel-height
  703.      This function returns the height of this X screen in pixels.
  704.  
  705.  - Function: x-display-mm-height
  706.      This function returns the height of this X screen in millimeters.
  707.  
  708.  - Function: x-display-pixel-width
  709.      This function returns the width of this X screen in pixels.
  710.  
  711.  - Function: x-display-mm-width
  712.      This function returns the width of this X screen in millimeters.
  713.  
  714.  - Function: x-display-backing-store
  715.      This function returns the backing store capability of this screen.
  716.      Values can be the symbols `always', `when-mapped', or `not-useful'.
  717.  
  718.  - Function: x-display-save-under
  719.      This function returns non-`nil' if this X screen supports the
  720.      SaveUnder feature.
  721.  
  722.  - Function: x-display-planes
  723.      This function returns the number of planes this display supports.
  724.  
  725.  - Function: x-display-visual-class
  726.      This function returns the visual class for this X screen.  The
  727.      value is one of the symbols `static-gray', `gray-scale',
  728.      `static-color', `pseudo-color', `true-color', and `direct-color'.
  729.  
  730.  - Function: x-display-color-p
  731.      This function returns `t' if the X screen in use is a color screen.
  732.  
  733.  - Function: x-display-color-cells
  734.      This function returns the number of color cells this X screen
  735.      supports.
  736.  
  737.  - Variable: x-no-window-manager
  738.      This variable's value is is `t' if no X window manager is in use.
  739.  
  740. 
  741. File: elisp,  Node: Positions,  Next: Markers,  Prev: Frames,  Up: Top
  742.  
  743. Positions
  744. *********
  745.  
  746.    A "position" is the index of a character in the text of buffer.
  747. More precisely, a position identifies the place between two characters
  748. (or before the first character, or after the last character), so we can
  749. speak of the character before or after a given position.  However, the
  750. character after a position is often said to be "at" that position.
  751.  
  752.    Positions are usually represented as integers starting from 1, but
  753. can also be represented as "markers"--special objects which relocate
  754. automatically when text is inserted or deleted so they stay with the
  755. surrounding characters.  *Note Markers::.
  756.  
  757. * Menu:
  758.  
  759. * Point::         The special position where editing takes place.
  760. * Motion::        Changing point.
  761. * Excursions::    Temporary motion and buffer changes.
  762. * Narrowing::     Restricting editing to a portion of the buffer.
  763.  
  764. 
  765. File: elisp,  Node: Point,  Next: Motion,  Prev: Positions,  Up: Positions
  766.  
  767. Point
  768. =====
  769.  
  770.    "Point" is a special buffer position used by many editing commands,
  771. including the self-inserting typed characters and text insertion
  772. functions.  Other commands move point through the text to allow editing
  773. and insertion at different places.
  774.  
  775.    Like other positions, point designates a place between two characters
  776. (or before the first character, or after the last character), rather
  777. than a particular character.  Many terminals display the cursor over the
  778. character that immediately follows point; on such terminals, point is
  779. actually before the character on which the cursor sits.
  780.  
  781.    The value of point is a number between 1 and the buffer size plus 1.
  782. If narrowing is in effect (*note Narrowing::.), then point is
  783. constrained to fall within the accessible portion of the buffer
  784. (possibly at one end of it).
  785.  
  786.    Each buffer has its own value of point, which is independent of the
  787. value of point in other buffers.  Each window also has a value of point,
  788. which is independent of the value of point in other windows on the same
  789. buffer.  This is why point can have different values in various windows
  790. that display the same buffer.  When a buffer appears in only one window,
  791. the buffer's point and the window's point normally have the same value,
  792. so the distinction is rarely important.  *Note Window Point::, for more
  793. details.
  794.  
  795.  - Function: point
  796.      This function returns the position of point in the current buffer,
  797.      as an integer.
  798.  
  799.           (point)
  800.                => 175
  801.  
  802.  - Function: point-min
  803.      This function returns the minimum accessible value of point in the
  804.      current buffer.  This is 1, unless narrowing is in effect, in
  805.      which case it is the position of the start of the region that you
  806.      narrowed to.  (*Note Narrowing::.)
  807.  
  808.  - Function: point-max
  809.      This function returns the maximum accessible value of point in the
  810.      current buffer.  This is `(1+ (buffer-size))', unless narrowing is
  811.      in effect, in which case it is the position of the end of the
  812.      region that you narrowed to.  (*Note Narrowing::).
  813.  
  814.  - Function: buffer-end FLAG
  815.      This function returns `(point-min)' if FLAG is less than 1,
  816.      `(point-max)' otherwise.  The argument FLAG must be a number.
  817.  
  818.  - Function: buffer-size
  819.      This function returns the total number of characters in the current
  820.      buffer.  In the absence of any narrowing (*note Narrowing::.),
  821.      `point-max' returns a value one larger than this.
  822.  
  823.           (buffer-size)
  824.                => 35
  825.           (point-max)
  826.                => 36
  827.  
  828.  - Variable: buffer-saved-size
  829.      The value of this buffer-local variable is the former length of the
  830.      current buffer, as of the last time it was read in, saved or
  831.      auto-saved.
  832.  
  833. 
  834. File: elisp,  Node: Motion,  Next: Excursions,  Prev: Point,  Up: Positions
  835.  
  836. Motion
  837. ======
  838.  
  839.    Motion functions change the value of point, either relative to the
  840. current value of point, relative to the beginning or end of the buffer,
  841. or relative to the edges of the selected window.  *Note Point::.
  842.  
  843. * Menu:
  844.  
  845. * Character Motion::       Moving in terms of characters.
  846. * Word Motion::            Moving in terms of words.
  847. * Buffer End Motion::      Moving to the beginning or end of the buffer.
  848. * Text Lines::             Moving in terms of lines of text.
  849. * Screen Lines::           Moving in terms of lines as displayed.
  850. * Vertical Motion::        Implementation of `next-line' and
  851.                              `previous-line'.
  852. * List Motion::            Moving by parsing lists and sexps.
  853. * Skipping Characters::    Skipping characters belonging to a certain set.
  854.  
  855. 
  856. File: elisp,  Node: Character Motion,  Next: Word Motion,  Prev: Motion,  Up: Motion
  857.  
  858. Motion by Characters
  859. --------------------
  860.  
  861.    These functions move point based on a count of characters.
  862. `goto-char' is a fundamental primitive because it is the way to move
  863. point to a specified position.
  864.  
  865.  - Command: goto-char POSITION
  866.      This function sets point in the current buffer to the value
  867.      POSITION.  If POSITION is less than 1, then point is set to the
  868.      beginning of the buffer.  If it is greater than the length of the
  869.      buffer, then point is set to the end of the buffer.
  870.  
  871.      If narrowing is in effect, then the position is still measured
  872.      from the beginning of the buffer, but point cannot be moved
  873.      outside of the accessible portion.  Therefore, if POSITION is too
  874.      small, point is set to the beginning of the accessible portion of
  875.      the text; if POSITION is too large, point is set to the end.
  876.  
  877.      When this function is called interactively, POSITION is the
  878.      numeric prefix argument, if provided; otherwise it is read from the
  879.      minibuffer.
  880.  
  881.      `goto-char' returns POSITION.
  882.  
  883.  - Command: forward-char &optional COUNT
  884.      This function moves point forward, towards the end of the buffer,
  885.      COUNT characters (or backward, towards the beginning of the
  886.      buffer, if COUNT is negative).  If the function attempts to move
  887.      point past the beginning or end of the buffer (or the limits of the
  888.      accessible portion, when narrowing is in effect), an error is
  889.      signaled with error code `beginning-of-buffer' or `end-of-buffer'.
  890.  
  891.      In an interactive call, COUNT is the numeric prefix argument.
  892.  
  893.  - Command: backward-char &optional COUNT
  894.      This function moves point backward, towards the beginning of the
  895.      buffer, COUNT characters (or forward, towards the end of the
  896.      buffer, if COUNT is negative).  If the function attempts to move
  897.      point past the beginning or end of the buffer (or the limits of
  898.      the accessible portion, when narrowing is in effect), an error is
  899.      signaled with error code `beginning-of-buffer' or `end-of-buffer'.
  900.  
  901.      In an interactive call, COUNT is the numeric prefix argument.
  902.  
  903. 
  904. File: elisp,  Node: Word Motion,  Next: Buffer End Motion,  Prev: Character Motion,  Up: Motion
  905.  
  906. Motion by Words
  907. ---------------
  908.  
  909.    These functions for parsing words use the syntax table to decide
  910. whether a given character is part of a word.  *Note Syntax Tables::.
  911.  
  912.  - Command: forward-word COUNT
  913.      This function moves point forward COUNT words (or backward if
  914.      COUNT is negative).  Normally it returns `t'.  If this motion
  915.      encounters the beginning or end of the buffer, or the limits of the
  916.      accessible portion when narrowing is in effect, point stops there
  917.      and the value is `nil'.
  918.  
  919.      In an interactive call, COUNT is set to the numeric prefix
  920.      argument.
  921.  
  922.  - Command: backward-word COUNT
  923.      This function just like `forward-word', except that it moves
  924.      backward until encountering the front of a word, rather than
  925.      forward.
  926.  
  927.      In an interactive call, COUNT is set to the numeric prefix
  928.      argument.
  929.  
  930.      This function is rarely used in programs, as it is more efficient
  931.      to call `forward-word' with negative argument.
  932.  
  933.  - Variable: words-include-escapes
  934.      This variable affects the behavior of `forward-word' and everything
  935.      that uses it.  If it is non-`nil', then characters in the "escape"
  936.      and "character quote" syntax classes count as part of words.
  937.      Otherwise, they do not.
  938.  
  939. 
  940. File: elisp,  Node: Buffer End Motion,  Next: Text Lines,  Prev: Word Motion,  Up: Motion
  941.  
  942. Motion to an End of the Buffer
  943. ------------------------------
  944.  
  945.    To move point to the beginning of the buffer, write:
  946.  
  947.      (goto-char (point-min))
  948.  
  949. Likewise, to move to the end of the buffer, use:
  950.  
  951.      (goto-char (point-max))
  952.  
  953.    Here are two commands which users use to do these things.  They are
  954. documented here to warn you not to use them in Lisp programs, because
  955. they set the mark and display messages in the echo area.
  956.  
  957.  - Command: beginning-of-buffer &optional N
  958.      This function moves point to the beginning of the buffer (or the
  959.      limits of the accessible portion, when narrowing is in effect),
  960.      setting the mark at the previous position.  If N is non-`nil',
  961.      then it puts point N tenths of the way from the beginning of the
  962.      buffer.
  963.  
  964.      In an interactive call, N is the numeric prefix argument, if
  965.      provided; otherwise N defaults to `nil'.
  966.  
  967.      Don't use this function in Lisp programs!
  968.  
  969.  - Command: end-of-buffer &optional N
  970.      This function moves point to the end of the buffer (or the limits
  971.      of the accessible portion, when narrowing is in effect), setting
  972.      the mark at the previous position.  If N is non-`nil', then it puts
  973.      point N tenths of the way from the end.
  974.  
  975.      In an interactive call, N is the numeric prefix argument, if
  976.      provided; otherwise N defaults to `nil'.
  977.  
  978.      Don't use this function in Lisp programs!
  979.  
  980. 
  981. File: elisp,  Node: Text Lines,  Next: Screen Lines,  Prev: Buffer End Motion,  Up: Motion
  982.  
  983. Motion by Text Lines
  984. --------------------
  985.  
  986.    Text lines are portions of the buffer delimited by newline
  987. characters, which are regarded as part of the previous line.  The first
  988. text line begins at the beginning of the buffer, and the last text line
  989. ends at the end of the buffer whether or not the last character is a
  990. newline.  The division of the buffer into text lines is not affected by
  991. the width of the window, or by how tabs and control characters are
  992. displayed.
  993.  
  994.  - Command: goto-line LINE
  995.      This function moves point to the front of the LINEth line,
  996.      counting from line 1 at beginning of buffer.  If LINE is less than
  997.      1, then point is set to the beginning of the buffer.  If LINE is
  998.      greater than the number of lines in the buffer, then point is set
  999.      to the *end of the last line* of the buffer.
  1000.  
  1001.      If narrowing is in effect, then LINE still counts from the
  1002.      beginning of the buffer, but point cannot go outside the accessible
  1003.      portion.  So point is set at the beginning or end of the accessible
  1004.      portion of the text if the line number specifies a position that is
  1005.      inaccessible.
  1006.  
  1007.      The return value of `goto-line' is the difference between LINE and
  1008.      the line number of the line to which point actually was able move
  1009.      (before taking account of any narrowing).  Thus, the value is
  1010.      positive if the scan encounters the end of the buffer.
  1011.  
  1012.      In an interactive call, LINE is the numeric prefix argument if one
  1013.      has been provided.  Otherwise LINE is read in the minibuffer.
  1014.  
  1015.  - Command: beginning-of-line &optional COUNT
  1016.      This function moves point to the beginning of the current line.
  1017.      With an argument COUNT not `nil' or 1, it moves forward COUNT-1
  1018.      lines and then to the beginning of the line.
  1019.  
  1020.      If this function reaches the end of the buffer (or of the
  1021.      accessible portion, if narrowing is in effect), it positions point
  1022.      at the beginning of the last line.  No error is signaled.
  1023.  
  1024.  - Command: end-of-line &optional COUNT
  1025.      This function moves point to the end of the current line.  With an
  1026.      argument COUNT not `nil' or 1, it moves forward COUNT-1 lines and
  1027.      then to the end of the line.
  1028.  
  1029.      If this function reaches the end of the buffer (or of the
  1030.      accessible portion, if narrowing is in effect), it positions point
  1031.      at the end of the last line.  No error is signaled.
  1032.  
  1033.  - Command: forward-line &optional COUNT
  1034.      This function moves point forward COUNT lines, to the beginning of
  1035.      the line.  If COUNT is negative, it moves point -COUNT lines
  1036.      backward, to the beginning of the line.
  1037.  
  1038.      If the beginning or end of the buffer (or of the accessible
  1039.      portion) is encountered before that many lines are found, then
  1040.      point stops at the beginning or end.  No error is signaled.
  1041.  
  1042.      `forward-line' returns the difference between COUNT and the number
  1043.      of lines actually moved.  If you attempt to move down five lines
  1044.      from the beginning of a buffer that has only three lines, point
  1045.      will positioned at the end of the last line, and the value will be
  1046.      2.
  1047.  
  1048.      In an interactive call, COUNT is the numeric prefix argument.
  1049.  
  1050.  - Function: count-lines START END
  1051.      This function returns the number of lines between the positions
  1052.      START and END in the current buffer.  If START and END are equal,
  1053.      then it returns 0.  Otherwise it returns at least 1, even if START
  1054.      and END are on the same line.  This is because the text between
  1055.      them, considered in isolation, must contain at least one line
  1056.      unless it is empty.
  1057.  
  1058.      Here is an example of using `count-lines':
  1059.  
  1060.           (defun current-line ()
  1061.             "Return the vertical position of point
  1062.           in the selected window.  Top line is 0.
  1063.           Counts each text line only once, even if it wraps."
  1064.             (+ (count-lines (window-start) (point))
  1065.                (if (= (current-column) 0) 1 0)
  1066.                -1))
  1067.  
  1068.    Also see the functions `bolp' and `eolp' in *Note Near Point::.
  1069. These functions do not move point, but test whether it is already at the
  1070. beginning or end of a line.
  1071.  
  1072. 
  1073. File: elisp,  Node: Screen Lines,  Next: Vertical Motion,  Prev: Text Lines,  Up: Motion
  1074.  
  1075. Motion by Screen Lines
  1076. ----------------------
  1077.  
  1078.    The line functions in the previous section count text lines,
  1079. delimited only by newline characters.  By contrast, these functions
  1080. count screen lines, which are defined by the way the text appears on
  1081. the screen.  A text line is a single screen line if it is short enough
  1082. to fit the width of the selected window, but otherwise it may occupy
  1083. several screen lines.
  1084.  
  1085.    In some cases, text lines are truncated on the screen rather than
  1086. continued onto additional screen lines.  Then `vertical-motion' moves
  1087. point just like `forward-line'.  *Note Truncation::.
  1088.  
  1089.    Because the width of a given string depends on the flags which
  1090. control the appearance of certain characters, `vertical-motion' will
  1091. behave differently on a given piece of text found in different buffers.
  1092. It will even act differently in different windows showing the same
  1093. buffer, because the width may differ and so may the truncation flag.
  1094. *Note Usual Display::.
  1095.  
  1096.  - Function: vertical-motion COUNT
  1097.      This function moves point to the start of the screen line COUNT
  1098.      screen lines down from the screen line containing point.  If COUNT
  1099.      is negative, it moves up instead.
  1100.  
  1101.      This function returns the number of lines moved.  The value may be
  1102.      less in absolute value than COUNT if the beginning or end of the
  1103.      buffer was reached.
  1104.  
  1105.  - Command: move-to-window-line COUNT
  1106.      This function moves point with respect to the text currently
  1107.      displayed in the selected window.  Point is moved to the beginning
  1108.      of the screen line COUNT screen lines from the top of the window.
  1109.      If COUNT is negative, point moves either to the beginning of the
  1110.      line -COUNT lines from the bottom or else to the last line of the
  1111.      buffer if the buffer ends above the specified screen position.
  1112.  
  1113.      If COUNT is `nil', then point moves to the beginning of the line
  1114.      in the middle of the window.  If the absolute value of COUNT is
  1115.      greater than the size of the window, then point moves to the place
  1116.      which would appear on that screen line if the window were tall
  1117.      enough.  This will probably cause the next redisplay to scroll to
  1118.      bring that location onto the screen.
  1119.  
  1120.      In an interactive call, COUNT is the numeric prefix argument.
  1121.  
  1122.      The value returned is the window line number, with the top line in
  1123.      the window numbered 0.
  1124.  
  1125. 
  1126. File: elisp,  Node: Vertical Motion,  Next: List Motion,  Prev: Screen Lines,  Up: Motion
  1127.  
  1128. The User-Level Vertical Motion Commands
  1129. ---------------------------------------
  1130.  
  1131.    A goal column is useful if you want to edit text such as a table in
  1132. which you want to move point to a certain column on each line.  The goal
  1133. column affects the vertical text line motion commands, `next-line' and
  1134. `previous-line'.  *Note Basic Editing Commands: (emacs)Basic.
  1135.  
  1136.  - User Option: goal-column
  1137.      This variable holds an explicitly specified goal column for
  1138.      vertical line motion commands.  If it is an integer, it specifies
  1139.      a column, and these commands try to move to that column on each
  1140.      line.  If it is `nil', then the commands set their own goal
  1141.      columns.  Any other value is invalid.
  1142.  
  1143.  - Variable: temporary-goal-column
  1144.      This variable holds the temporary goal column during a sequence of
  1145.      consecutive vertical line motion commands.  It is overridden by
  1146.      `goal-column' if that is non-`nil'.  It is set each time a
  1147.      vertical motion command is invoked, unless the previous command
  1148.      was also a vertical motion command.
  1149.  
  1150.  - User Option: track-eol
  1151.      This variable controls how the vertical line motion commands
  1152.      operate when starting at the end of a line.  If `track-eol' is
  1153.      non-`nil', then vertical motion starting at the end of a line will
  1154.      keep to the ends of lines.  This means moving to the end of each
  1155.      line moved onto.  The value of `track-eol' has no effect if point
  1156.      is not at the end of a line when the first vertical motion command
  1157.      is given.
  1158.  
  1159.      `track-eol' has its effect by causing `temporary-goal-column' to
  1160.      be set to 9999 instead of to the current column.
  1161.  
  1162.  - Command: set-goal-column UNSET
  1163.      This command sets the variable `goal-column' to specify a permanent
  1164.      goal column for the vertical line motion commands.  If UNSET is
  1165.      `nil', then `goal-column' is set to the current column of point.
  1166.      If UNSET is non-`nil', then `goal-column' is set to `nil'.
  1167.  
  1168.      This function is intended for interactive use; and in an
  1169.      interactive call, UNSET is the raw prefix argument.
  1170.  
  1171. 
  1172. File: elisp,  Node: List Motion,  Next: Skipping Characters,  Prev: Vertical Motion,  Up: Motion
  1173.  
  1174. Moving over Balanced Expressions
  1175. --------------------------------
  1176.  
  1177.    Here are several functions concerned with balanced-parenthesis
  1178. expressions (also called "sexps" in connection with moving across them
  1179. in Emacs).  The syntax table controls how these functions interpret
  1180. various characters; see *Note Syntax Tables::.  *Note Parsing
  1181. Expressions::, for lower-level primitives for scanning sexps or parts of
  1182. sexps.  For user-level commands, see *Note Lists and Sexps:
  1183. (emacs)Lists and Sexps.
  1184.  
  1185.  - Command: forward-list ARG
  1186.      Move forward across ARG balanced groups of parentheses.  (Other
  1187.      syntactic entities such as words or paired string quotes are
  1188.      ignored.)
  1189.  
  1190.  - Command: backward-list ARG
  1191.      Move backward across ARG balanced groups of parentheses.  (Other
  1192.      syntactic entities such as words or paired string quotes are
  1193.      ignored.)
  1194.  
  1195.  - Command: up-list ARG
  1196.      Move forward out of ARG levels of parentheses.  A negative
  1197.      argument means move backward but still to a less deep spot.
  1198.  
  1199.  - Command: down-list ARG
  1200.      Move forward down ARG levels of parentheses.  A negative argument
  1201.      means move backward but still go down ARG level.
  1202.  
  1203.  - Command: forward-sexp ARG
  1204.      Move forward across ARG balanced expressions.  Balanced
  1205.      expressions include both those delimited by parentheses and other
  1206.      kinds, such as words and string constants.  For example,
  1207.  
  1208.           ---------- Buffer: foo ----------
  1209.           (concat-!- "foo " (car x) y z)
  1210.           ---------- Buffer: foo ----------
  1211.           
  1212.           (forward-sexp 3)
  1213.                => nil
  1214.           
  1215.           ---------- Buffer: foo ----------
  1216.           (concat "foo " (car x) y-!- z)
  1217.           ---------- Buffer: foo ----------
  1218.  
  1219.  - Command: backward-sexp ARG
  1220.      Move backward across ARG balanced expressions.
  1221.  
  1222. 
  1223. File: elisp,  Node: Skipping Characters,  Prev: List Motion,  Up: Motion
  1224.  
  1225. Skipping Characters
  1226. -------------------
  1227.  
  1228.    The following two functions move point over a specified set of
  1229. characters.  For example, they are often used to skip whitespace.  For
  1230. related functions, see *Note Motion and Syntax::.
  1231.  
  1232.  - Function: skip-chars-forward CHARACTER-SET &optional LIMIT
  1233.      This function moves point in the current buffer forward, skipping
  1234.      over a given set of characters.  Emacs first examines the
  1235.      character following point; if it matches CHARACTER-SET, then point
  1236.      is advanced and the next character is examined.  This continues
  1237.      until a character is found that does not match.  The function
  1238.      returns `nil'.
  1239.  
  1240.      The argument CHARACTER-SET is like the inside of a `[...]' in a
  1241.      regular expression except that `]' is never special and `\' quotes
  1242.      `^', `-' or `\'.  Thus, `"a-zA-Z"' skips over all letters,
  1243.      stopping before the first nonletter, and `"^a-zA-Z'" skips
  1244.      nonletters stopping before the first letter.  *Note Regular
  1245.      Expressions::.
  1246.  
  1247.      If LIMIT is supplied (it must be a number or a marker), it
  1248.      specifies the maximum position in the buffer that point can be
  1249.      skipped to.  Point will stop at or before LIMIT.
  1250.  
  1251.      In the following example, point is initially located directly
  1252.      before the `T'.  After the form is evaluated, point is located at
  1253.      the end of that line (between the `t' of `hat' and the newline).
  1254.      The function skips all letters and spaces, but not newlines.
  1255.  
  1256.           ---------- Buffer: foo ----------
  1257.           I read "-!-The cat in the hat
  1258.           comes back" twice.
  1259.           ---------- Buffer: foo ----------
  1260.           
  1261.           (skip-chars-forward "a-zA-Z ")
  1262.                => nil
  1263.           
  1264.           ---------- Buffer: foo ----------
  1265.           I read "The cat in the hat-!-
  1266.           comes back" twice.
  1267.           ---------- Buffer: foo ----------
  1268.  
  1269.  - Function: skip-chars-backward CHARACTER-SET &optional LIMIT
  1270.      This function moves point backward, skipping characters that match
  1271.      CHARACTER-SET.  It just like `skip-chars-forward' except for the
  1272.      direction of motion.
  1273.  
  1274.